package impl.agentt.enseignant;

import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable;

import fr.irit.smac.may.lib.interfaces.Push;
import fr.irit.smac.may.lib.pmbehaviour.PatternMatchingBehavior;
import contraintes.ContrainteDispo;
import message.EDTMessage;
import mysticedt.Behaviour;

public class BehaviourEnsImpl extends Behaviour{
	private Hashtable<ContrainteDispo,Integer> listContrainteDispo;
	private ArrayList<Integer> listIdSeance;
	
	PatternMatchingBehavior pmb = new PatternMatchingBehavior(this);
	
	public BehaviourEnsImpl() {
		this.listContrainteDispo = new Hashtable<ContrainteDispo,Integer>();
		this.listIdSeance = new ArrayList<Integer>();
	}

	@Override
	protected Push<EDTMessage> cycle() {
		return new Push<EDTMessage>() {
			public void push(EDTMessage message) {
				pmb.match(message);
			}
			
		};
	}
	
	public void ajoutSeance(int idSeance) {
		this.listIdSeance.add(idSeance);
	}
	
	public void ajoutContrainteDispo(int id, Date deb, Date fin) {
		this.listContrainteDispo.put(new ContrainteDispo(id,deb,fin), id);
	}
}
